<template>
  <cj-popup v-model="isShow" position="bottom" round title="编辑赠言" :closeable="true" >
    <article class="c-pt50 c-ph24">
      <header class="c-fs26">赠言</header>
      <section class="c-mt10 c-w100 c-ph20 c-pv24 c-bg-f5 c-fs26 c-flex-column c-br10">
        <textarea v-model="presentMsg" class="c-hh80 c-bg-transparent c-bd0" maxlength="30" placeholder="请输入赠言" />
        <span class="c-fc-sgray c-ml-auto c-pt10 c-pb20 c-pr20">{{presentMsg.length}}/30</span>
      </section>
    </article>
    <footer class="c-box-shadow6 c-hh88 c-pv12 c-ph24">
      <div @click="tapConfirm" class="c-w100 c-h c-flex-row c-flex-center theme-bg c-fc-white c-fs24">确定</div>
    </footer>
  </cj-popup>
</template>

<script>

export default {
  components:{},

  props:{},

  data() {
    return {
      isShow: false,
      presentMsg: ""
    }
  },

  created() {},

  methods:{
    pubilc_openEditMsg(msg) {
      this.isShow = true;
      this.presentMsg = msg;
    },
    tapConfirm() {
      if (!this.presentMsg) {
        this.$showCjToast({
          text: '请输入赠言',
          type: 'warn',
          time: 1000
        });
        return;
      }
      if (this.presentMsg.length > 30) {
        this.$showCjToast({
          text: '最多支持输入30个字符',
          type: 'warn',
          time: 1000
        });
        return;
      }
      this.isShow = false;
      this.$emit('confirmPresentMsg', this.presentMsg);
    },
  },

}
</script>

<style scoped>

</style>